<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <button>按钮</button>
    <script src="./jquery-1.12.4.js"></script>
    <script>
      $('button').on('click', function () {
        $.ajax({
          url: 'http://localhost:5000/test',
          // 如果dataType的值是jsonp,就表示要利用jsonp发送请求,解决跨域问题
          dataType: 'jsonp', //
          success: function (data) {
            console.log(data)
          },
        })
      })
    </script>
  </body>
</html>
